package com.doit.day01;

import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPubSub;

public class PublishDemo {
    public static void main(String[] args) {
        Jedis jedis = new Jedis("linux01", 6379);
        jedis.subscribe(new JedisPubSub() {
            @Override
            public void onMessage(String channel, String message) {
                System.out.println("收到了来自"+channel + "的消息，消息是："+message);
            }
        },"A","B","C");
    }
}
